package com.itheima.chapter03.service.impl;

import com.itheima.chapter03.domain.Article;
import com.itheima.chapter03.mapper.ArticleMapper;
import com.itheima.chapter03.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public List<Article> list(Article article) {
        return articleMapper.selectArticleList(article);
    }

    @Override
    public int insert(Article article) {
        return articleMapper.insertArticle(article);
    }

    @Override
    public int delete(Integer id) {
        return articleMapper.removeArticle(id);
    }

    @Override
    public Article selectById(Integer id) {
        return articleMapper.selectArticleById(id);
    }
}
